﻿using System.Collections.Generic;
using System.Collections.Specialized;
using System.Security.Principal;
using Com.FastSearch.SharePoint.BL.SearchManager;
using Com.FastSearch.SharePoint.Interfaces;

namespace ESPWebPartsUnitTest.mock
{
    class ESPSearchManagerMock: IESPSearchManager
    {
        private string qrservers = "http://localhost:15100/";

        public IESPSearchResult Search(IESPSearchSettings searchSettings, WindowsIdentity windowsIdentity)
        {
            //
            return null;
        }

        public StringCollection GetSearchViews()
        {
            StringCollection sc = new StringCollection();
            sc.Add("espsystemwebcluster");
            sc.Add("MockView1");
            sc.Add("MockView2");
            sc.Add("MockView3");
            return sc;
        }

        public List<ISortField> GetSortableFieldsAndRankProfiles(string value)
        {
            List<ISortField> sc = new List<ISortField>();
            
            sc.Add(new SortField("default", true));
            sc.Add(new SortField("MockRankProfile1", true));
            sc.Add(new SortField("MockRankProfile1", true));
            sc.Add(new SortField("MockRankProfile1", false));
            sc.Add(new SortField("MockRankProfile1", false));
            return sc;
        }

        public IDictionary<string, IESPNavigatorDefinition> GetNavigatorsForView(string viewName)
        {
            IDictionary<string, IESPNavigatorDefinition> navigators = new Dictionary<string, IESPNavigatorDefinition>(3);
            navigators["languagesnavigator"] = new ESPNavigatorDefinition("languagesnavigator", "Languages", false);
            navigators["personnamesnavigator"] = new ESPNavigatorDefinition("personnamesnavigator", "People", false);
            navigators["scopenavigator0"] = new ESPNavigatorDefinition("scopenavigator0", "Scope 0", true);
            return navigators;
        }

        public string SPWebApplicationQRServersConfig
        {
            get
            {
                return qrservers;
            }
            set
            {
                qrservers = value;
            }
        }
    }
}
